package com.jiuzhe.commercial.ui.my;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.jiuzhe.commercial.R;
import com.jiuzhe.commercial.base.BaseActivity;
import com.jiuzhe.commercial.base.BaseApplication;
import com.jiuzhe.commercial.constant.Constants;
import com.jiuzhe.commercial.main.LoginActivity;
import com.jiuzhe.commercial.utils.SPUtil;
import com.jiuzhe.commercial.utils.UIUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by huanghao on 2018/5/25.
 */

public class UserActivity extends BaseActivity {
    @BindView(R.id.tv_settings)
    TextView tvSettings;
    @BindView(R.id.tv_about)
    TextView tvAbout;


    @Override
    protected void loadViewLayout() {
        setContentView(R.layout.activity_user);
        setTitle("个人资料");
    }

    @Override
    protected void loadData() {

    }


    @OnClick({R.id.tv_settings,R.id.tv_about,R.id.bt_out})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_settings:
                UIUtils.startActivity(PaySettingActivity.class);
                break;
            case R.id.tv_about:
                UIUtils.startActivity(AboutUserActivity.class);
                break;
            case R.id.bt_out:
                SPUtil.put(this, Constants.ID,"");
                SPUtil.put(this, Constants.MERCHANTID,"");
                SPUtil.put(this, Constants.TOKEN,"");
                SPUtil.put(this, Constants.PHONE,"");
                SPUtil.put(this,"isLogin",false);
                Constants.PHONE = "";
                BaseApplication.perfectExit();
                Intent intent  = new Intent(this, LoginActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);
                break;
        }
    }
}
